(defun radius (entity)
  (if (equal (cdr (assoc 0 entity)) "CIRCLE")
    (cdr (assoc 40 entity))
    nil
  )
)
(defun center (entity)
  (if (equal (cdr (assoc 0 entity)) "CIRCLE")
    (cdr (assoc 10 entity))
    nil
  )
)
(defun is-fit (ent1 ent2)
  (if (< (distance (center ent1) (center ent2))
	 (+ (radius ent1) (radius ent2))
      )
    (if	(> (radius ent1) (radius ent2))
      t
      nil
    )
    nil
  )
)
(defun ss-other-c (ename)
  (if (equal (cdr (assoc 0 (entget ename))) "CIRCLE")
    (ssdel ename (ssget "_X" '((0 . "CIRCLE"))))
    nil
  )
)
(defun ss->list	(sset)
  (cond
    ((equal sset nil) nil)
    (t
     (append (if (ssname sset 0)
	       (list (ssname sset 0))
	     )
	     (ss->list (if (= (sslength sset) 0)
			 nil
			 (ssdel (ssname sset 0) sset)
		       )
	     )
     )
    )
  )
)

(defun circle-has-child (ename)
  (apply 'or
	 (mapcar '(lambda (x) (is-fit (entget ename) (entget x)))
		 (ss->list (ss-other-c ename))
	 )
  )
)